package it.lefo.dateReminder.model;

import it.lefo.dateReminder.helper.Utilities;

import java.io.Serializable;
import java.util.Date;

import android.database.Cursor;

public class Contact implements Serializable{

	private static final long serialVersionUID = 1L;
	
	private String _name;
	private String _surname;
	private String _nickname;
	private Date _birthdate;
	private String _txtmessage;
	private Integer _id;
	private String _phone;
	private String _typeEvent;
	
	public Contact(){
	}
	
	public Contact(Cursor cur){
		setBirthdate(Utilities.StringToDate(cur.getString(cur.getColumnIndex("birthdate"))));
		setName(cur.getString(cur.getColumnIndex("name")));
		setSurname(cur.getString(cur.getColumnIndex("surname")));
		setNickname(cur.getString(cur.getColumnIndex("nickname")));
		setTxtmessage(cur.getString(cur.getColumnIndex("txtmessage")));
		setId(Integer.parseInt(cur.getString(cur.getColumnIndex("id"))));
		setPhone(cur.getString(cur.getColumnIndex("phone")));
		setTypeEvent(cur.getString(cur.getColumnIndex("typeevent")));
	}
	
	public void setPhone(String phone) {
		_phone = phone;
	}
	
	public String getPhone(){
		return _phone;
	}
	
	public void setTypeEvent(String typeEvent) {
		_typeEvent = typeEvent;
	}
	
	public String getTypeEvent(){
		return _typeEvent;
	}

	public String getName(){
		return _name;
	}
	
	public void setName(String value){
		_name = value;
	}
	
	public String getSurname(){
		return _surname;
	}
	
	public void setSurname(String value){
		_surname = value;
	}
	
	public String getNickname(){
		return _nickname;
	}
	
	public void setNickname(String value){
		_nickname = value;
	}
	
	public Date getBirthdate(){
		return _birthdate;
	}
	
	public void setBirthdate(Date value){
		_birthdate = value;
	}
	
	public String getTxtmessage(){
		return _txtmessage;
	}
	
	public void setTxtmessage(String value){
		_txtmessage = value;
	}
	
	public Integer getId(){
		return _id;
	}
	
	public void setId(Integer value){
		_id = value;
	}
	
	@Override
	public String toString(){		
		return _name + " " + _surname;		
	}
}
